﻿<div ng-controller="billHoldingCenterController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">库存票中心</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <!--<select class="form-control" ng-model="filter.billType">
                                        <option value="">请选择票据类型</option>
                                        <option value="101">电票</option>
                                        <option value="102">纸票</option>
                                    </select>-->
                                    <select class="form-control" ng-model="model.bill_price" ng-change="selectBillPrice()">
                                        <option value="">请选择票面金额</option>
                                        <option ng-model="" value="">全部</option>
                                        <option ng-model="model.bill_price">0-10万元</option>
                                        <option ng-model="model.bill_price">10万元-50万元</option>
                                        <option ng-model="model.bill_price">50万元-100万元</option>
                                        <option ng-model="model.bill_price">大于100万元</option>
                                    </select>
                                    <select id="" class="form-control" ng-model="model.bill_date" ng-change="selectBillDate()">
                                        <option value="">请选择到期期限</option>
                                        <option value="">全部</option>
                                        <option ng-model="model.bill_date">0-90天</option>
                                        <option ng-model="model.bill_date">90天-150天</option>
                                        <option ng-model="model.bill_date">150天-186天</option>
                                        <option ng-model="model.bill_date">186天-330天</option>
                                        <option ng-model="model.bill_date">大于330天</option>
                                    </select>
                                    <select class="form-control" ng-model="filter.acceptType">
                                        <option value="">请选择承兑机构</option>
                                        <option value="">全部</option>
                                        <option value="401">国股</option>
                                        <option value="402">城商</option>
                                        <option value="404">三农</option>
                                        <option value="405">村镇</option>
                                        <option value="406">外资</option>
                                        <option value="407">财务公司</option>
                                        <option value="408">商票</option>
                                    </select>
                                    <select class="form-control" ng-model="filter.bill_status">
                                        <option value="">请选择票据状态</option>
                                        <option value="">全部</option>
                                        <option value="-10">未发布</option>
                                        <option value="10">已发布</option>
                                    </select>
                                    <!--<br />-->
                                    <span>
                                        期望利率：
                                        <input class="form-control" type="text" ng-model="filter.bill_rate_min" />
                                        <input class="form-control" type="text" ng-model="filter.bill_rate_max" />
                                     </span>
                                    <span>企业简称：<input class="form-control" type="text" ng-model="filter.enterprise_name" /></span>
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-search"></i> 筛选</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html" class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'发布时间'" sortable="'bill_product_create_time'" class="text-center">{{ item.bill_product_create_time | date:'MM-yy HH:mm' }}</td>
                            <td data-title="'企业名称'" sortable="'drawer_name'" class="text-center">{{ item.drawer_name | limitTo:8 }}{{item.drawer_name.length > 8 ? '...' : ''}}</td>
                            <!--<td data-title="'票据类型'" sortable="'bill_type_id'" class="text-center">{{ item.bill_type_id == 102 ? '纸票' : '电票' }}</td>-->
                            <td data-title="'承兑机构'" sortable="'acceptor_type_name'" class="text-center">{{ item.acceptor_type_name == null || item.acceptor_type_name == '' || item.acceptor_type_name == undefined ? '--' : item.acceptor_type_name }}</td>
                            <td data-title="'票面金额'" sortable="'bill_sum_price'" class="text-center">{{ item.bill_sum_price | currency }}</td>
                            <td data-title="'承兑人'" sortable="'acceptor_name'" class="text-center">{{ item.acceptor_name == null || item.acceptor_name == '' || item.acceptor_name == undefined ? '--' : item.acceptor_name | limitTo:8 }}</td>
                            <td data-title="'到期时间'" sortable="'bill_deadline_time'" class="text-center">{{ item.bill_deadline_time | date:'yyyy-MM-dd' }}</td>
                            <!--<td data-title="'背书瑕疵'" sortable="'bill_flaw_ids'" class="text-center">{{ (item.bill_flaw_ids | myfilter) == 1500 ? '无瑕疵' : '有瑕疵' }}</td>-->
                            <!--<td data-title="'竞价方式'" sortable="'bidding_mode'" class="text-center">{{ item.bidding_mode == 3210 ? '一口价' : "自由竞价" }}</td>-->
                            <td data-title="'联系人'" sortable="'contact_name'" class="text-center">{{ item.contact_name }}</td>
                            <td data-title="'联系方式'" sortable="'contact_phone'" class="text-center">{{ item.contact_phone }}</td>
                            <td data-title="'状态'" sortable="'bill_status_name'" class="text-center">{{ item.bill_status_name }}</td>
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="resd(item)">
                                    <i class="fa fa-edit"></i> 详细
                                </button>
                            </td>
                            <!--<td data-title="'企业'" sortable="'drawer_name'" class="text-center">{{ item.drawer_name }}</td>
                            <td data-title="'联系人'" sortable="'contact_name'" class="text-center">{{ item.contact_name }}</td>
                            <td data-title="'联系方式'" sortable="'contact_phone'" class="text-center">{{ item.contact_phone }}</td>-->
                        </tr>
                    </table>
                </div>

                <div class="modal fade" id="modal-read">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <ng-form name="resdForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>票据详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal">
                                        <div class="bill-detail" style="height:334px;">
                                            <p class="bill-detail-title">票据信息</p>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">票据号：</label>
                                                <div class="col-md-4 form-control-static">
                                                    <span>{{models.bill_number}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">票面金额：</label>
                                                <div class="col-md-4 form-control-static">
                                                    <span>{{models.bill_sum_price | currency}}</span>
                                                </div>
                                                <!--<span class="control-label">元</span>-->
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">承兑行行号：</label>
                                                <div class="col-md-4 form-control-static">
                                                    <span>{{models.acceptor_cnaps}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">承兑行名称：</label>
                                                <div class="col-md-4 form-control-static">
                                                    <span>{{models.acceptor_name}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">汇票到期日：</label>
                                                <div class="col-md-4 form-control-static">
                                                    <span>{{models.bill_deadline_time | date:'yyyy-MM-dd'}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">背书次数：</label>
                                                <div class="col-md-4 form-control-static">
                                                    <span>{{models.endorsement_number}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12" ng-if="models.bill_type_id == 101">
                                                <label class="control-label col-md-2">汇票瑕疵：</label>
                                                <div class="col-md-10 form-control-static">
                                                    <span ng-repeat="item in billFlawData" class="col-sm-3">
                                                        <input type="checkbox" ng-model="item.checked" disabled="disabled"> {{ item.constant_name }}
                                                    </span>
                                                </div>
                                            </div>
                                            <div class="col-md-12" ng-if="models.bill_type_id == 102">
                                                <label class="control-label col-md-2">汇票瑕疵：</label>
                                                <div class="col-md-10 form-control-static">
                                                    <span ng-repeat="item in billFlawData2" class="col-sm-3">
                                                        <input type="checkbox" ng-model="item.checked" disabled="disabled"> {{ item.constant_name }}
                                                    </span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">承兑机构：</label>
                                                <div class="col-md-10 form-control-static">
                                                    <span>{{models.acceptor_type_name}}</span>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="bill-detail pubEnter-detail" style="height:148px;">
                                            <p class="bill-detail-title">发布企业信息</p>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">企业名称：</label>
                                                <div class="col-md-10 form-control-static">
                                                    <span>{{models.publisher_name}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">联系人：</label>
                                                <div class="col-md-10 form-control-static">
                                                    <span>{{models.contact_name}}</span>
                                                </div>
                                            </div>
                                            <div class="col-md-12">
                                                <label class="control-label col-md-2">手机号：</label>
                                                <div class="col-md-10 form-control-static">
                                                    <span>{{models.contact_phone}}</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group width-full">
                                            <div class="col-sm-4">
                                                <span>汇票正面</span>
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{models.bill_front_photo_path}}" target="_blank" ng-if="models.bill_front_photo_path!=''">
                                                        <img class="jqzoom" height="100%" width="100%" src="{{models.bill_front_photo_path | addTimestamp}}" rel="{{models.bill_front_photo_path}}" alt="汇票正面未上传" />
                                                    </a>

                                                    <div ng-if="models.bill_front_photo_path==''">
                                                        汇票正面未上传
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-4">
                                                <span>汇票背书面1</span>
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{models.bill_back_files[0].file_path}}" target="_blank" ng-if="models.bill_back_files[0].file_path!=''">
                                                        <img height="100%" width="100%" class="jqzoom" src="{{models.bill_back_files[0].file_path | addTimestamp }}" rel="{{models.bill_back_files[0].file_path}}" alt="汇票正面未上传" />
                                                    </a>
                                                    <div ng-if="models.bill_back_files[0].file_path==''">
                                                        汇票背面未上传
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-4">
                                                <span>汇票背书面2</span>
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{models.bill_back_files[1].file_path}}" target="_blank" ng-if="models.bill_back_files[1].file_path!=''">
                                                        <img class="jqzoom" height="100%" width="100%" src="{{models.bill_back_files[1].file_path | addTimestamp}}" rel="{{models.bill_back_files[1].file_path}}" alt="汇票正面未上传" />
                                                    </a>

                                                    <div ng-if="models.bill_front_photo_path==''">
                                                        汇票背面未上传
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <!--<div class="form-group width-full">
                                            <div class="col-sm-4">
                                                <span>汇票正面涂抹后</span>
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{model.bill_front_photo_path|getEndorsementURL}}" target="_blank" ng-if="model.bill_front_photo_path!=''">
                                                        <img class="jqzoom" height="100%" width="100%" src="{{model.bill_front_photo_path | getEndorsementURL | addTimestamp}}" rel="{{model.bill_front_photo_path|getEndorsementURL}}" alt="汇票未背书" />
                                                    </a>

                                                    <div ng-if="model.bill_front_photo_path==''">
                                                        汇票未背书
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-4">
                                                <span>汇票背书面1涂抹后</span>
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{model.bill_back_files[0].file_path|getEndorsementURL|addTimestamp}}" target="_blank" ng-if="model.bill_back_files[0].file_path!=''">
                                                        <img height="100%" width="100%" class="jqzoom" src="{{model.bill_back_files[0].file_path|getEndorsementURL | addTimestamp }}" rel="{{model.bill_back_files[0].file_path|getEndorsementURL}}" alt="汇票背面未背书" />
                                                    </a>
                                                    <div ng-if="model.bill_back_files[0].file_path==''">
                                                        汇票背面未背书
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-sm-4">
                                                <span>汇票背书面2涂抹后</span>
                                                <div class="tb-booth tb-pic tb-s250">
                                                    <a href="{{model.bill_back_files[1].file_path|getEndorsementURL}}" target="_blank" ng-if="model.bill_back_files[1].file_path!=''">
                                                        <img class="jqzoom" height="100%" width="100%" src="{{model.bill_back_files[1].file_path | getEndorsementURL | addTimestamp}}" rel="{{model.bill_back_files[1].file_path|getEndorsementURL}}" alt="汇票未背书" />
                                                    </a>

                                                    <div ng-if="model.bill_back_files[1].file_path==''">
                                                        汇票背面未背书
                                                    </div>
                                                </div>
                                            </div>
                                        </div>-->

                                        <!--<div class="form-group width-full">
                                            <label class="control-label col-md-2">汇票备注：</label>
                                            <div class="col-md-4 form-margin-top">
                                                <span>{{model.description}}</span>
                                            </div>
                                        </div>-->
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

